package com.xiaohong.order.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY;

@Schema(name = "Order")
public class Order implements Serializable{

    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @Schema(description = "订单id",accessMode = READ_ONLY)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
	private String id;//订单id

    @Schema(description = "用户id")
    @TableField("userId")
	private String userId;//用户id

    @Schema(description = "数量合计")
    @TableField("total_num")
	private Integer totalNum;//数量合计

    @Schema(description = "金额合计")
    @TableField("total_money")
	private Float totalMoney;//金额合计

    @Schema(description = "优惠金额")
    @TableField("pre_money")
	private Float preMoney;//优惠金额

    @Schema(description = "邮费")
    @TableField("post_fee")
	private Float postFee;//邮费

    @Schema(description = "实付金额")
    @TableField("pay_money")
	private Float payMoney;//实付金额

    @Schema(description = "支付类型，支付类型 1 支付宝 2微信")
    @TableField("pay_type")
	private Integer payType;//支付类型，支付类型 1 支付宝 2微信

    @Schema(description = "付款时间")
    @TableField("pay_time")
	private Date payTime;//付款时间

    @Schema(description = "发货时间")
    @TableField("consign_time")
	private Date consignTime;//发货时间

    @Schema(description = "交易完成时间")
    @TableField("end_time")
	private Date endTime;//交易完成时间

    @Schema(description = "交易关闭时间")
    @TableField("close_time")
	private Date closeTime;//交易关闭时间

    @Schema(description = "物流名称")
    @TableField("shipping_name")
	private String shippingName;//物流名称

    @Schema(description = "物流单号")
    @TableField("shipping_code")
	private String shippingCode;//物流单号

    @Schema(description = "用户名称")
    @TableField("username")
	private String username;//用户名称

    @Schema(description = "买家留言")
    @TableField("buyer_message")
	private String buyerMessage;//买家留言

    @Schema(description = "是否评价")
    @TableField("buyer_rate")
	private Integer buyerRate;//是否评价

    @Schema(description = "收货人")
    @TableField("receiver_contact")
	private String receiverContact;//收货人

    @Schema(description = "收货人手机")
    @TableField("receiver_mobile")
	private String receiverMobile;//收货人手机

    @Schema(description = "收货人地址")
    @TableField("receiver_address")
	private String receiverAddress;//收货人地址

    @Schema(description = "订单来源：1:web，2：app，3：微信公众号，4：微信小程序  5 H5手机页面")
    @TableField("source_type")
	private Integer sourceType;//订单来源：1:web，2：app，3：微信公众号，4：微信小程序  5 H5手机页面

    @Schema(description = "交易流水号")
    @TableField("transaction_id")
	private String transactionId;//交易流水号

    @Schema(description = "订单状态,0:未完成,1:已完成，2：已退货")
    @TableField("order_status")
	private Integer orderStatus;//订单状态,0:未完成,1:已完成，2：已退货

    @Schema(description = "支付状态：0:待付款 1：已付款 2：付款失败 3：已退款 4：退款失败 5：交易结束（不可退款）")
    @TableField("pay_status")
	private Integer payStatus;//支付状态,0:未支付，1：已支付，2：支付失败

    @Schema(description = "发货状态,0:未发货，1：已发货，2：已收货")
    @TableField("consign_status")
	private Integer consignStatus;//发货状态,0:未发货，1：已发货，2：已收货

    @Schema(description = "逻辑删除标志",accessMode = READ_ONLY)
    @TableLogic
	private Integer deleted;//逻辑删除标志

    @Schema(description = "创建时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
	private Date gmtCreate;//创建时间

    @Schema(description = "更改时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_modified",fill = FieldFill.INSERT_UPDATE)
	private Date gmtModified;//更改时间

    @Schema(description = "乐观锁",accessMode = READ_ONLY)
    @Version
	private Integer version;//乐观锁

	@Schema(description = "子订单集合",accessMode = READ_ONLY)
	@TableField(exist = false)
	private List<OrderItem>  orderItems; // 子订单集合

	public List<OrderItem> getOrderItems() {
		return orderItems;
	}

	public void setOrderItems(List<OrderItem> orderItems) {
		this.orderItems = orderItems;
	}

	//get方法
	public String getId() {
		return id;
	}

	//set方法
	public void setId(String id) {
		this.id = id;
	}
	//get方法
	public String getUserId() {
		return userId;
	}

	//set方法
	public void setUserId(String userId) {
		this.userId = userId;
	}
	//get方法
	public Integer getTotalNum() {
		return totalNum;
	}

	//set方法
	public void setTotalNum(Integer totalNum) {
		this.totalNum = totalNum;
	}
	//get方法
	public Float getTotalMoney() {
		return totalMoney;
	}

	//set方法
	public void setTotalMoney(Float totalMoney) {
		this.totalMoney = totalMoney;
	}
	//get方法
	public Float getPreMoney() {
		return preMoney;
	}

	//set方法
	public void setPreMoney(Float preMoney) {
		this.preMoney = preMoney;
	}
	//get方法
	public Float getPostFee() {
		return postFee;
	}

	//set方法
	public void setPostFee(Float postFee) {
		this.postFee = postFee;
	}
	//get方法
	public Float getPayMoney() {
		return payMoney;
	}

	//set方法
	public void setPayMoney(Float payMoney) {
		this.payMoney = payMoney;
	}
	//get方法
	public Integer getPayType() {
		return payType;
	}

	//set方法
	public void setPayType(Integer payType) {
		this.payType = payType;
	}
	//get方法
	public Date getPayTime() {
		return payTime;
	}

	//set方法
	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}
	//get方法
	public Date getConsignTime() {
		return consignTime;
	}

	//set方法
	public void setConsignTime(Date consignTime) {
		this.consignTime = consignTime;
	}
	//get方法
	public Date getEndTime() {
		return endTime;
	}

	//set方法
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	//get方法
	public Date getCloseTime() {
		return closeTime;
	}

	//set方法
	public void setCloseTime(Date closeTime) {
		this.closeTime = closeTime;
	}
	//get方法
	public String getShippingName() {
		return shippingName;
	}

	//set方法
	public void setShippingName(String shippingName) {
		this.shippingName = shippingName;
	}
	//get方法
	public String getShippingCode() {
		return shippingCode;
	}

	//set方法
	public void setShippingCode(String shippingCode) {
		this.shippingCode = shippingCode;
	}
	//get方法
	public String getUsername() {
		return username;
	}

	//set方法
	public void setUsername(String username) {
		this.username = username;
	}
	//get方法
	public String getBuyerMessage() {
		return buyerMessage;
	}

	//set方法
	public void setBuyerMessage(String buyerMessage) {
		this.buyerMessage = buyerMessage;
	}
	//get方法
	public Integer getBuyerRate() {
		return buyerRate;
	}

	//set方法
	public void setBuyerRate(Integer buyerRate) {
		this.buyerRate = buyerRate;
	}
	//get方法
	public String getReceiverContact() {
		return receiverContact;
	}

	//set方法
	public void setReceiverContact(String receiverContact) {
		this.receiverContact = receiverContact;
	}
	//get方法
	public String getReceiverMobile() {
		return receiverMobile;
	}

	//set方法
	public void setReceiverMobile(String receiverMobile) {
		this.receiverMobile = receiverMobile;
	}
	//get方法
	public String getReceiverAddress() {
		return receiverAddress;
	}

	//set方法
	public void setReceiverAddress(String receiverAddress) {
		this.receiverAddress = receiverAddress;
	}
	//get方法
	public Integer getSourceType() {
		return sourceType;
	}

	//set方法
	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
	}
	//get方法
	public String getTransactionId() {
		return transactionId;
	}

	//set方法
	public void setTransactionId(String transactionId) {
		this.transactionId = transactionId;
	}
	//get方法
	public Integer getOrderStatus() {
		return orderStatus;
	}

	//set方法
	public void setOrderStatus(Integer orderStatus) {
		this.orderStatus = orderStatus;
	}
	//get方法
	public Integer getPayStatus() {
		return payStatus;
	}

	//set方法
	public void setPayStatus(Integer payStatus) {
		this.payStatus = payStatus;
	}
	//get方法
	public Integer getConsignStatus() {
		return consignStatus;
	}

	//set方法
	public void setConsignStatus(Integer consignStatus) {
		this.consignStatus = consignStatus;
	}
	//get方法
	public Integer getDeleted() {
		return deleted;
	}

	//set方法
	public void setDeleted(Integer deleted) {
		this.deleted = deleted;
	}
	//get方法
	public Date getGmtCreate() {
		return gmtCreate;
	}

	//set方法
	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}
	//get方法
	public Date getGmtModified() {
		return gmtModified;
	}

	//set方法
	public void setGmtModified(Date gmtModified) {
		this.gmtModified = gmtModified;
	}
	//get方法
	public Integer getVersion() {
		return version;
	}

	//set方法
	public void setVersion(Integer version) {
		this.version = version;
	}


}
